home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_c
/
lsdoor09.zip
/
EXAMPLE2.CPP
< prev
next >
Wrap
Text File
|
1996-05-15
|
723b
|
34 lines
// Example2.Cpp - Asking a Y/N Question safely...
#define MainModule
#include "LsDoor.H"
char *errorModule( void ){ return "Example II"; } // Identify ourself...
char c;
void main( void )
{
if( !DoorInit( doorsysDISABLE ) ) exit(1); // Get things started...
display("\n@WS@wtar @WW@wings @WG@wame" );
while( online )
{
display("\nDo you wish to play? (Y/N) ");
c = toupper( s_in() );
if( c == 'Y' || c == '\r' )
{
display("\nGame over."); exit(0);
}
if( c == 'N' )
{
display("\nReturning to the 20th century."); break;
}
}
exit(0); // Always use exit()
}
// End of Example2.Cpp